// 1.使用fp.add(x, y) 和 fp.map(f, x)创建一个能让functor里的值增加的函数 ex1
const fp = require('lodash/fp')
const { Maybe, Container } = require('./support')

let maybe = Maybe.of([5, 6, 1])

//加固定值
// let ex1 = arr => fp.map(fp.add(1), arr)
// let r = maybe.map(ex1)
// console.log(r);

//优化
//数组内的值可以增加任意大的值
let ex1 = (num, arr) => {
    return fp.map(fp.add(num), arr)
}

//柯里化ex1
let ex1ed = fp.curry(ex1)

let r = maybe.map(ex1ed(3))
console.log(r);